#pragma once
#include <BWAPI.h>
#include "UnitGroup.h"

// This is a worker action some worker actions are continuous so all unused
// workers should be placed in idle so it can resume its continuous actoins.
using namespace std;

// Inherit from this class to determine the priority and reassign
// based on game needs.
class BuildingCompare
{
public:
	bool operator() (PUnitType& lhs, PUnitType& rhs);
};

class BuildAction : public BasicAction
{
	int workerCount;
	priority_queue<PUnitType, vector<PUnitType>, BuildingCompare> *buildQueue;

	void _onActionStart();
	void _onActionStop();
	void _onFrame();
public:
	BuildAction();
	~BuildAction();
	BuildAction* clone();
	void addBuildingRequest(PUnitType uType);
};